Analysis of Feature Engineering on LSTM and GRU Forecasting Performance Across Food Commodities with Different Volatility Levels
##plugins.themes.bootstrap3.article.main##
Abstract
Food commodity price prediction plays a crucial role in monitoring food price stability and inflation, particularly for commodities with varying volatility characteristics. This study compares the performance of Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) models in forecasting daily food commodity prices in Bandung City, using chili and rice dataset. Daily price data were collected and modeled in two experimental scenarios: forecasting using only historical price data and forecasting with temporal feature engineering. The results showed that GRU consistently outperformed LSTM across all experiments. Without feature engineering, GRU achieved a MAPE score 0.49% and 3.26% for rice and chili, respectively. The incorporation of temporal features improved forecasting performance, reducing forecasting errors by up to 31.30% for rice and 29.55% for chili. The best overall performance was achieved by the GRU model with temporal feature engineering (MAPE rice = 0.48% and MAPE chili = 2.48%). These findings indicate that incorporating feature engineering remains beneficial for enhancing deep learning models performance. This study contributes to the development of deep learning methods for food commodity price forecasting and provides an understanding of the role of temporal feature engineering in handling commodities with different levels of volatility.
##plugins.themes.bootstrap3.article.details##

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish articles in CoreID Journal agree to the following terms:
- Authors retain copyright of the article and grant the journal right of first publication with the work simultaneously licensed under a CC-BY-SA or The Creative Commons Attribution–ShareAlike License.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).
References
W. Z. Siregar, R. P. Wibowo, and E. Siahaan, “Socioeconomic Dimensions of Food Price Fluctuations and Regional Inflation in Indonesia: Insights from Java and Sumatra,” Baileo: Jurnal Sosial Humaniora, vol. 3, no. 2, pp. 332–352, Oct. 2025, doi: 10.30598/baileofisipvol3iss2pp332-352.
O. Akinyemi, H. O. Omisore, and J. A. Kupolusi, “Analysis of Food Price Indices and Inflation Rate in Nigeria,” International Journal of Science for Global Sustainability, vol. 11, no. 1, pp. 33–37, Mar. 2025, doi: 10.57233/ijsgs.v11i1.779
Rohimuddin and J. L. Panjawa, “The Impact of Food Commodity Prices on Inflation in Bekasi,” Marginal Journal Of Management Accounting General Finance And International Economic Issues, vol. 2, no. 1, pp. 193–206, Sep. 2022, doi: 10.55047/marginal.v2i1.376.
Laura Vantania Safitri, M. Ridwansyah, Rosmeli Rosmeli, Erni Achmad, Nurhayani Nurhayani, and Zainul Bahri, “Analysis Contributor Inflation Group ‘Volatile Food’ from Sector Agriculture in Jambi Province,” International Journal of Economics and Management Research, vol. 4, no. 2, pp. 609–619, May 2025, doi: 10.55606/ijemr.v4i2.401.
C. J. Anwar, I. Suhendra, A. Srimulyani, V. M. Zahara, R. A. F. Ginanjar, and S. C. Suci, “Food Price and Inflation Volatilities during Covid-19 Period: Empirical Study of a Region in Indonesia,” WSEAS TRANSACTIONS ON BUSINESS AND ECONOMICS, vol. 20, pp. 1839–1848, Aug. 2023, doi: 10.37394/23207.2023.20.161.
H. H. Win and T. T. Zin, “Time Series Forecasting of Commodity Prices Using ARIMA, Holt-Winters and LSTM,” in 2025 6th International Conference on Advanced Information Technologies (ICAIT), IEEE, Nov. 2025, pp. 1–6. doi: 10.1109/ICAIT68809.2025.11236779.
D. SJ, P. DV, S. MS, and R. SR, “Time series forecasting of price for oilseed crops by combining ARIMA and ANN,” International Journal of Statistics and Applied Mathematics, vol. 8, no. 4, pp. 40–54, Jul. 2023, doi: 10.22271/maths.2023.v8.i4a.1098.
C. Liu, “Long short-term memory (LSTM)-based news classification model,” PLoS One, vol. 19, no. 5, p. e0301835, May 2024, doi: 10.1371/journal.pone.0301835.
M. Krichen and A. Mihoub, “Long Short-Term Memory Networks: A Comprehensive Survey,” AI, vol. 6, no. 9, p. 215, Sep. 2025, doi: 10.3390/ai6090215.
J. Xu, Z. Wang, X. Li, Z. Li, and Z. Li, “Prediction of Daily Climate Using Long Short-Term Memory (LSTM) Model,” International Journal of Innovative Science and Research Technology (IJISRT), pp. 83–90, Jul. 2024, doi: 10.38124/ijisrt/IJISRT24JUL073.
M. Cho, C. Kim, K. Jung, and H. Jung, “Water Level Prediction Model Applying a Long Short-Term Memory (LSTM)–Gated Recurrent Unit (GRU) Method for Flood Prediction,” Water (Basel), vol. 14, no. 14, p. 2221, Jul. 2022, doi: 10.3390/w14142221.
P. Wanda, “GRUSpam: robust e-mail spam detection using gated recurrent unit (GRU) algorithm,” International Journal of Information Technology, vol. 15, no. 8, pp. 4315–4322, Dec. 2023, doi: 10.1007/s41870-023-01516-z.
S. Mohsen, “Recognition of human activity using GRU deep learning algorithm,” Multimed Tools Appl, vol. 82, no. 30, pp. 47733–47749, Dec. 2023, doi: 10.1007/s11042-023-15571-y.
P. Joshi, J. Bhardwaj, S. Størdal, M. Kolhe, and E. Haugom, “Analysis of Feature Engineering in Deep Learning Architectures for Dynamic Electricity Price Forecasting,” in 2025 International Conference on Artificial Intelligence, Computer, Data Sciences and Applications (ACDSA), IEEE, Aug. 2025, pp. 1–5. doi: 10.1109/ACDSA65407.2025.11165808.
B. M. Porto and F. S. Fogliatto, “Enhanced forecasting of emergency department patient arrivals using feature engineering approach and machine learning,” BMC Med Inform Decis Mak, vol. 24, no. 1, p. 377, Dec. 2024, doi: 10.1186/s12911-024-02788-6.
Y. Suhanda, I. Kurniati, and S. Norma, “Penerapan Metode Crisp-DM dengan Algoritma K-Means Clustering Untuk Segmentasi Mahasiswa Berdasarkan Kualitas Akademik,” J. Teknol. Inform. dan Komput. MH Thamrin, vol. 6, no. 2, pp. 12–20, 2020.
M. Lewinski, “Statistical Forecasting Methods and Machine Learning Models in Hierarchical Forecasting for Supply Chain Applications,” Nov. 2024, pp. 286–295. doi: 10.21741/9781644903315-33.
Ü. Aycel and Y. Santur, “A New moving average approach to predict the direction of stock movements in algorithmic trading,” Journal of New Results in Science, vol. 11, no. 1, pp. 13–25, Apr. 2022, doi: 10.54187/jnrs.979836.
R. J. Hyndman, “Moving averages,” in International Encyclopedia of Statistical Science, M. Lovric, Ed. Berlin, Heidelberg, Germany: Springer, 2025, pp. 1559–1562.
L. B. V. de Amorim, G. D. C. Cavalcanti, and R. M. O. Cruz, “The choice of scaling technique matters for classification performance,” Appl Soft Comput, vol. 133, p. 109924, Jan. 2023, doi: 10.1016/j.asoc.2022.109924.
G. van Houdt, C. Mosquera, and G. Nápoles, “A review on the long short-term memory model,” Artif Intell Rev, vol. 53, no. 8, pp. 5929–5955, Dec. 2020, doi: 10.1007/s10462-020-09838-1.
X. Wen and W. Li, “Time Series Prediction Based on LSTM-Attention-LSTM Model,” IEEE Access, vol. 11, pp. 48322–48331, 2023, doi: 10.1109/ACCESS.2023.3276628.
K. Cho, B. van Merrienboer, D. Bahdanau, and Y. Bengio, “On the Properties of Neural Machine Translation: Encoder–Decoder Approaches,” in Proceedings of SSST-8, Eighth Workshop on Syntax, Semantics and Structure in Statistical Translation, Stroudsburg, PA, USA: Association for Computational Linguistics, 2014, pp. 103–111. doi: 10.3115/v1/W14-4012.
A. Shewalkar, D. Nyavanandi, and S. A. Ludwig, “Performance Evaluation of Deep Neural Networks Applied to Speech Recognition: RNN, LSTM and GRU,” Journal of Artificial Intelligence and Soft Computing Research, vol. 9, no. 4, pp. 235–245, Oct. 2019, doi: 10.2478/jaiscr-2019-0006.
T. O. Hodson, “Root-mean-square error (RMSE) or mean absolute error (MAE): when to use them or not,” Jul. 19, 2022, Copernicus GmbH. doi: 10.5194/gmd-15-5481-2022.
G. van Houdt, C. Mosquera, and G. Nápoles, “A review on the long short-term memory model,” Artif Intell Rev, vol. 53, no. 8, pp. 5929–5955, Dec. 2020, doi: 10.1007/s10462-020-09838-1.